package org.linys.model.dict;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.linys.model.BaseModel;
import org.springframework.stereotype.Component;

/**
 * 货物类型
 * 
 * @author LYS
 * 
 */
@Component("GoodsType")
public class GoodsType extends BaseModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer goodsTypeID;
	private String goodsTypeName;
	private String goodsTypeCode;
	private Integer parentGoodsTypeID;
	List<GoodsType> childrenGoodsType = new ArrayList<GoodsType>();
	
	
	@Override
	public String toString() {
		String baseJSON = "{" + "\"id\":\"" + goodsTypeID + "\",\"text\":\""+ goodsTypeName + "\",\"state\":\"" + state+ "\",\"children\":[";
		String childrenJSON = "";
		for (GoodsType goodsType : this.childrenGoodsType) {
			if ("".equals(childrenJSON)) {
				childrenJSON += goodsType.toString();
			} else {
				childrenJSON += "," + goodsType.toString();
			}
		}
		return baseJSON + childrenJSON + "]}";
	}
	
	public Integer getGoodsTypeID() {
		return goodsTypeID;
	}
	public void setGoodsTypeID(Integer goodsTypeID) {
		this.goodsTypeID = goodsTypeID;
	}
	public String getGoodsTypeName() {
		return goodsTypeName;
	}
	public void setGoodsTypeName(String goodsTypeName) {
		this.goodsTypeName = goodsTypeName;
	}
	public String getGoodsTypeCode() {
		return goodsTypeCode;
	}
	public void setGoodsTypeCode(String goodsTypeCode) {
		this.goodsTypeCode = goodsTypeCode;
	}
	public Integer getParentGoodsTypeID() {
		return parentGoodsTypeID;
	}
	public void setParentGoodsTypeID(Integer parentGoodsTypeID) {
		this.parentGoodsTypeID = parentGoodsTypeID;
	}
	public List<GoodsType> getChildrenGoodsType() {
		return childrenGoodsType;
	}
	public void setChildrenGoodsType(List<GoodsType> childrenGoodsType) {
		this.childrenGoodsType = childrenGoodsType;
	}

	

}
